package com.my.test.thread.conditition.old;

public class Product extends Thread {

	@Override
	public void run() {
		MyQueue<String> myQueue = TestMyQueue.myQueue;
		int num = 0;
		while(true) {
			try {
				//num = num++;//bug
				num++;
				//num = num+1; ok
				//++num; ok
				//num++ 等价于 num = num+1;
				myQueue.add("data:"+num);
				System.out.println("生产数据：data:"+num);
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}

}
